package com.example.mywiseelves.view;

import android.animation.ValueAnimator;
import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;

import com.example.mywiseelves.R;

/**
 * @author ZJK
 * @data 2021 21
 * @description
 */
public class TreeView extends androidx.appcompat.widget.AppCompatImageView {
        Animation animation;

    public TreeView(Context context) {
        super(context);
    }

    public TreeView(Context context, AttributeSet attrs) {
        super(context, attrs);
        animation= AnimationUtils.loadAnimation(getContext(), R.anim.anim_tree);
        animation.setRepeatMode(ValueAnimator.REVERSE);
        LinearInterpolator interpolator = new LinearInterpolator();
        animation.setInterpolator(interpolator);
        this.startAnimation(animation);
    }
}
